package cc.mrbird.handle.service.impl;

import cc.mrbird.handle.dao.HandleMapper;
import cc.mrbird.handle.domain.Handle;
import cc.mrbird.handle.service.HandleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class HandleServiceImpl implements HandleService {
    @Autowired
    private HandleMapper handleMapper;

    @Override
    public List<Handle> getHandleList(Handle handle) {
        return handleMapper.getHandleList(handle);
    }

    @Override
    public void saveHandle(Handle handle) {
        handleMapper.saveHandle(handle);
    }

    @Override
    public Handle getByHandleId(Handle handle) {
        List<Handle> list = handleMapper.getHandleList(handle);
        if (list == null || list.size()==0){
            return null;
        }
        return list.get(0);
    }

    @Override
    public void updateHandle(Handle handle) {
        handleMapper.updateHandle(handle);
    }

    @Override
    public void saveHandle1(Handle handle) {
        handleMapper.saveHandle1(handle);
    }
}
